package com.netease.adapter;
import com.netease.fragment.FragmentA;
import com.netease.fragment.FragmentB;
import com.netease.fragment.FragmentC;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.Log;

public class MyFragmentAdapter extends FragmentPagerAdapter {
	//设置初始总页数
	public static final int PageNum=3;

	public MyFragmentAdapter(FragmentManager fm) {
		super(fm);
		// TODO Auto-generated constructor stub
	}

	@Override
	public Fragment getItem(int arg0) {
		// TODO Auto-generated method stub
		Log.v("MyFragmentAdapter", "得到："+arg0);
		switch(arg0)
		{
		case 0:return new FragmentA();
		case 1:return new FragmentB();
		case 2:return new FragmentC();
		default:return null;
		}
		
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return PageNum;
	}

}
